<?php
namespace common\components;
use backend\models\system\SysConfig;
use backend\models\system\FriendLink;
use Yii;
/**
 * 作者：d.coffee
 * 时间：2015-11-25
 * 功能：系统配置
 */
class ConfigInfo{
    public static $config_1 = "BASIC_INFORMATION";//基础信息
	public static $config_2 = "THEME";//主题
	public static $config_3 = "EMAIL_SERVER";//邮件服务器设置
	public static $config_4 = "TOP_NAV";//顶部导航
	public static $config_5 = "BOTTOM_NAV";//底部导航
	public static $config_6 = "CUSTOMER_SERVICE";//客服
	public static $config_7 = "SIDEBAR";//侧边栏
	public static $config_8 = "SHARE";//分享
	public static $config_9 = "USER_INFORMATION";//用户信息设置
	public static $config_10 = "REGISTER";//注册
	public static $config_11 = "LOGIN";//登陆
	public static $config_12 = "DEFAULT_AVATAR";//默认头像
	public static $config_13 = "COURSE";//课程
	public static $config_14 = "DIRECT_SEEDING";//直播
	public static $config_15 = "DEFAULT_PICTURE";//默认图片
	public static $config_16 = "CONSULTATION";//咨询
	public static $config_17 = "PAYMENT";//支付
	public static $config_18 = "RECHARGE";//充值
	public static $config_19 = "MOBILE_TERMINAL";//移动端设置
	public static $config_20 = "IP_BLACK";//IP黑名单
	public static $config_21 = "SITE_ANNOUNCEMENT";//站点公告
    

    /**
     * 读取配置
     */
    static public function getConfig(){
        $data = SysConfig::sysMessage();
        foreach($data as $k=>$v)
        {
            $key = "config_".$v['config_type'];
            $config["'".self::$$key."'"]["'".strtoupper($v['config_key'])."'"] = $v['config_value'];
        }
        $config['SERVER']['FILE_SERVER'] = "files.bwphp.com";
        $config['SERVER']['VIDEO_SERVER'] = "files.bwphp.com";
		/*底部导航   友情链接*/
		$model = new FriendLink();
	    $config['FRIEND_LINK'] = $model->friendlinksellimit();

        Yii::$app->params['sysconfig'] = $config;
    }
    

}